package cn.itsource.ymcc.web.controller;

import cn.itsource.ymcc.result.JSONResult;
import cn.itsource.ymcc.service.IVerifycodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/verifycode")
public class VerifycodeController {
    @Autowired//common/verifycode/imageCode
    private IVerifycodeService iVerifycodeService;
//    @GetMapping("/imageCode/{imageCodeKey}")//imageCode/"+imageCodeKey
//    public JSONResult ImageCode(@PathVariable("imageCodeKey") String key){
//        try {
//            String base64Str=iVerifycodeService.ImageCode(key);
//            return JSONResult.success(base64Str);
//        }catch( Exception e){
//            e.printStackTrace();
//            return null;
//        }
//    }

    @GetMapping("/sendSmsCode/{mobile}")
    public JSONResult smsCode(@PathVariable("mobile") String mobile){
        iVerifycodeService.smsCode(mobile);
        return JSONResult.success();
        }




}
